package com.lhl.fw.core.exception;

import lombok.Getter;

/**
 * @className: CommonErrorCode
 * @description: TODO 类描述
 * @author: king
 * @date: 2020-07-04 13:17
 **/
@Getter
public enum CommonErrorCode {
    SUCCESS("200", "操作成功"),
    SYS_ERROR("2001001000", "服务端发生异常"),
    FAILED("500", "业务异常异常"),
    NOT_FOUND("404", "无法找到这个资源啦"),
    UNAUTHORIZED("401", "暂未登录或token已经过期"),
    FORBIDDEN("403", "没有相关权限"),
    MISSING_REQUEST_PARAM_ERROR("2001001001", "参数缺失"),
    INVALID_REQUEST_PARAM_ERROR("2001001002", "请求参数不合法"),
    // ========== 基础错误 ==========
    CLASS_CAST_EXCEPTION("500", "类转换异常"),
    ARR_EXCEPTION("5001", "数组下表越界异常"),
    FILE_NOT_FOUND_EXCEPTION("500", "文件找不到"),
    IO_Exception("500", "输入输出流异常"),
    NULL_EXCEPTION("500", "空指针异常"),
    DIVISOR_IS_ZERO_EXCEPTION("500", "除数为零"),
    DEFAULT_ERROR("500", "自定义异常"),
    // ========== 用户模块 ==========
    USER_NOT_FOUND("1001002000", "用户不存在"),

    // ========== 订单模块 ==========

    // ========== 商品模块 ==========

    // ========== 微信模块 ==========
    WX_ERROR("1001002000", "用户不存在"),
    ;

    private String code;

    private String message;

    CommonErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
